/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fmsactionserver.server.inetclient;

import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author rbs
 */
class FMSClient {

    public FMSClient() {
        try {
            Socket client = new Socket("188.64.45.53", 11202);
            PrintWriter writer = new PrintWriter(client.getOutputStream(), true);
            writer.println("1.0");
            writer.println("GET_ALL");
            
            BufferedReader reader = new BufferedReader(new InputStreamReader(client.getInputStream()));
            
            String readLine = "";
            while (!readLine.equals("200 CONNECTION CLOSE"))
            {
                readLine = reader.readLine();
                System.out.println(readLine);
            }
        } catch (UnknownHostException ex) {
            Logger.getLogger(FMSClient.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(FMSClient.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    
}
